package net.tngou.crawler.company;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import net.tngou.crawler.jdbc.OrderType;
import net.tngou.crawler.pojo.City;
import net.tngou.crawler.pojo.Latlng;
import net.tngou.crawler.pojo.POJO;

public class CityUtil {

	public static void main(String[] args) throws IOException {

		 List<City> list = (List<City>) new City().list("province_name='四川省'", "id", OrderType.DESC);
		 List<Latlng> larlngs= new ArrayList<>();
		 for (City city : list) {
			 Latlng e= new Latlng(city.getLat(), city.getLng());
			 larlngs.add(e);
		 }
		
		 Latlng[] os = new Latlng[larlngs.size()];
		 Latlng max = LatLngUtil.maxLatlng( larlngs.toArray(os));
		 Latlng min = LatLngUtil.minLatlng( larlngs.toArray(os));
		 System.err.println(min);
		 System.err.println(max);
		 
	}
}
